package com.wswy.wzcx.aanewApi.baseUtils;

/**
 *
 */
public class Toast {
    private static android.widget.Toast toast = null;

    public static void show(String content) {
        show(content, -1, android.widget.Toast.LENGTH_SHORT);
    }

    public static void show(String content, int time) {
        show(content, -1, time);
    }

    public static void show(String content, int center, int time) {
        if (HApi.getContext() == null) return;
        cancel();
        toast = android.widget.Toast.makeText(HApi.getContext(), content, time);
        if (center != -1) toast.setGravity(center, 0, 0);
        toast.show();
    }

    public static void cancel() {
        if (toast != null)
            toast.cancel();
    }
}
